package com.charging.service.impl;

import com.charging.dao.FaultReportDao;
import com.charging.entity.FaultReport;
import com.charging.service.FaultService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
import java.util.Map;

@Service
public class FaultServiceImpl implements FaultService {

    @Resource
    private FaultReportDao faultReportDao;

    @Override
    public FaultReport getFaultById(Long id) {
        return faultReportDao.selectById(id);
    }

    @Override
    public List<FaultReport> getAllFaults(){
        return faultReportDao.getAllFaults();
    }

    @Override
    public void addFault(FaultReport fault) {
        faultReportDao.insert(fault);
    }

    @Override
    public void updateFault(FaultReport fault) {
        faultReportDao.update(fault);
    }

    @Override
    public void deleteFault(Long id) {
        faultReportDao.delete(id);
    }

    @Override
    public List<FaultReport> findFaultsByPage(int page, int pageSize) {
        return Collections.emptyList();
    }

    @Override
    public long findFaultCount() {
        return faultReportDao.faultCount();
    }

    @Override
    public List<FaultReport> getFaultHistoryByPile(Integer pileId) {
        return Collections.emptyList();
    }

    @Override
    public boolean handleFault(Integer faultId, Integer handlerId, String action) {
        return false;
    }

    @Override
    public List<FaultReport> getPendingFaults() {
        return Collections.emptyList();
    }

    @Override
    public List<FaultReport> getFaultsByStatus(String status) {
        return Collections.emptyList();
    }

    @Override
    public Map<String, Integer> getWeeklyFaultStats() {
        return Collections.emptyMap();
    }
}
